@echo off
:: config no console mode
if "%1"=="hide" goto start_jar
start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit

:start_jar
:: config the jar path
set "JAR_FILE=device-application.jar"
set "JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Dfile.encoding=UTF-8"

:: check if jar file exist
if not exist "%JAR_FILE%" (
    echo error: JAR file "%JAR_FILE%" not exist
    goto :END
)

:: check java command
java -version >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo error: java command not installed
    goto :END
)

:: start jar
echo start %JAR_FILE%...
java %JAVA_OPTS% -jar "%JAR_FILE%"





